<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="container">
    Counter: {{counter}}
</div>

<script src="https://unpkg.com/vue@next"></script>
<script type="text/javascript">

    const demoApp = {
        data(){
            return {
                counter: 1
            }
        },
        mounted(){
            setInterval(() => { //注意这种写法，需要进一步的解释
                this.counter++
            }, 1000)

            // setInterval(
            //     'this.counter++'
            // , 1000)

            // setInterval(increaseCounter, 1000)
        },
        methods:{
            increaseCounter(){
                this.counter++
            }
        }
    }

    Vue.createApp(demoApp).mount('#container')
</script>

</body>
</html>
